package com.design.graduation.asdemo.activity;

import android.app.Activity;
import android.os.Bundle;
import android.support.v7.widget.RecyclerView;
import android.widget.TextView;

import com.amap.api.maps.AMap;
import com.amap.api.maps.MapView;
import com.amap.api.maps.UiSettings;
import com.design.graduation.asdemo.R;

/**
 * Created by lijinyuan on 16/2/18.
 */

public class CheckDetailsActivity extends Activity {
    public MapView mapView;
    public AMap aMap;
    public TextView mPrice, mPhone, mMapText;
    public RecyclerView imgRecyclerView, contentRecyclerView;


    @Override
    public void onSaveInstanceState(Bundle outState) {
        super.onSaveInstanceState(outState);
        if (mapView != null && outState != null) {
            mapView.onSaveInstanceState(outState);
        }
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_check_details);
        init();
//        mMapText.setVisibility(View.GONE);
        mapView = (MapView) findViewById(R.id.details_map);
        mapView.onCreate(savedInstanceState);
        if (aMap == null) {
            aMap = mapView.getMap();
        }

        setUpMap();
    }

    public void init() {

        imgRecyclerView = (RecyclerView) findViewById(R.id.details_img);
        contentRecyclerView = (RecyclerView) findViewById(R.id.details_content);
        mPhone = (TextView) findViewById(R.id.details_phone);
        mPrice = (TextView) findViewById(R.id.details_price);
//        mMapText= (TextView) findViewById(R.id.details_map_text);

    }

    private void setUpMap() {
        UiSettings uiSettings = aMap.getUiSettings();
        uiSettings.setScaleControlsEnabled(true);
        uiSettings.setMyLocationButtonEnabled(false);
        uiSettings.setZoomControlsEnabled(false);
        uiSettings.setRotateGesturesEnabled(false);
        aMap.setMyLocationEnabled(true);
        aMap.setMyLocationType(AMap.LOCATION_TYPE_LOCATE);
    }


    @Override
    protected void onResume() {
        super.onResume();
        mapView.onResume();
    }

    @Override
    protected void onPause() {
        super.onPause();
        mapView.onPause();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        mapView.onDestroy();
    }


    public void initView() {


    }

}
